import { Component, OnInit } from '@angular/core';

import * as moment from 'moment';

import $ from 'github:components/jquery@3.1.0.js';
import bootstrap from 'twbs/bootstrap';
import bootstrap_css from 'twbs/bootstrap/css/bootstrap.css!';

import _ace from 'ace';
import 'github:ajaxorg/ace-builds@1.2.5/theme-monokai.js';
import 'github:ajaxorg/ace-builds@1.2.5/mode-typescript.js';

import * as _template from './app.component.html';
import * as _css from './app.component.css';
import * as _data from './data.json';

let template = _template && _template.default ? _template.default : _template;
let css = _css && _css.default ? _css.default : _css;
let data = _data && _data.default ? _data.default : _data;

let ace = _ace && _ace.default ? _ace.default : _ace;

// declare var __moduleName: string;
@Component({
  // http://blog.thoughtram.io/angular/2016/06/08/component-relative-paths-in-angular-2.html
  // moduleId: __moduleName.id,
  selector: 'app',
  template : template,
  styleUrl: [css, bootstrap_css],
})
export class AppComponent implements OnInit{

  constructor() {}

  ngOnInit() {
    let editor = ace.edit("editor");
    editor.setTheme("ace/theme/monokai");
    editor.getSession().setMode("ace/mode/javascript");
  }

}
